package com.milhouz.wormdroid.gl.model.hud;

import android.graphics.Paint;

import com.milhouz.wormdroid.gl.model.text.TextSprite;

public class TeamHudSprite extends TextSprite {

	private String teamName;
	private int teamPower;
	private boolean isSelected;

	public TeamHudSprite(int teamNumber, String name, int power, float x, float y, Paint paint) {
		super(TEAM_SPRITE + teamNumber, x, y, paint);
		this.teamName = name;
		this.teamPower = power;
		super.setText(teamName.toUpperCase() + "  -  " + teamPower + "%");
	}

	public void setPower(int power) {
		this.teamPower = power;
		updateTeamInfo();
	}

	public void setIsSelected(boolean isSelected) {
		this.isSelected = isSelected;
		updateTeamInfo();
	}

	public void updateTeamInfo() {
		if (isSelected)
			super.setText(teamName.toUpperCase() + "* -  " + teamPower + "%");
		else
			super.setText(teamName.toUpperCase() + "  -  " + teamPower + "%");
	}

}
